package meta.api.web.common.presentation.interceptor;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import meta.api.web.common.util.ApiUtil;

@Component
public class ApiCorsInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest req, HttpServletResponse res, Object hdl) throws Exception {
        return ApiUtil.isAllowedOrigin(req, res);
    }
}
